home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d19 / 15rpch33.arc / QBDTRPCH.ARC / DTRPATCH.DOC next >
Text File  |  1988-09-28  |  7KB  |  253 lines

  1.                      DTR Fix for QuickBasic
  2.                            Jeff Porter
  3.                              1-5-86
  4.  
  5. As anyone who has tried to write any programs that use  COM1:  or
  6. COM2: with MicroSoft QuickBasic knows, the DTR modem control line
  7. is  dropped everytime a a communication file is opened or closed.
  8. I don't know why MicroSoft drops the DTR line all the time; all I
  9. know  is that it can be a serious problem with programs  such  as
  10. RBBS-PC.   Therefore,  I  present the following patch to fix  the
  11. problem.
  12.  
  13. This  patch  modifies the serial communication  routines  in  the
  14. BCOM10.LIB  file so that the DTR line will be not be turned off.
  15.  
  16. Here  is  a  transcript  of  a  patch  session.    More  detailed
  17. instructions follow it.
  18.  
  19. C>copy bcom10.lib bcom10bk.lib
  20.       1 File(s) copied
  21.  
  22. C>debug bcom10.lib
  23. -d540 L 10
  24. xxxx:0540  0B D2 75 04 B5 FF EB 34-FA 83 C2 04 32 C0 EE EB   ..u....4....2...
  25. -d830 L 10
  26. xxxx:0830  14 8B FA E8 00 00 83 C2-04 32 C0 EB 00 EE C7 47   .........2.....G
  27. -a54c
  28. xxxx:054C mov al, 1
  29. xxxx:054E
  30. -a839
  31. xxxx:0839 mov al, 1
  32. xxxx:083B
  33. -w
  34. Writing 25C00 bytes
  35. -q
  36.  
  37.  
  38. 1.   Make a backup copy of the BCOM10.LIB file, just in case.
  39.  
  40. 2.   Run debug and load BCOM10.LIB
  41.  
  42.      C>debug bcom10.lib
  43.  
  44. 3.   Display  the  following sections of data and see  that  they
  45.      match.   This is to insure that you are patching the correct
  46.      version of the library.
  47.  
  48. -d540 L 10
  49. xxxx:0540  0B D2 75 04 B5 FF EB 34-FA 83 C2 04 32 C0 EE EB   ..u....4....2...
  50. -d830 L 10
  51. xxxx:0830  14 8B FA E8 00 00 83 C2-04 32 C0 EB 00 EE C7 47   .........2.....G
  52.  
  53. 4.   If  debug shows the same information as listed  above,  then
  54.      you may continue with the patching process.   If not,  go to
  55.      the section Patching other Library Files.
  56.  
  57. 5.   Do the following:
  58.  
  59.      -a 54c
  60.      xxxx:054C mov al, 1
  61.      xxxx:054E
  62.      -a 839
  63.      xxxx:0839 mov al, 1
  64.      xxxx:083B
  65.  
  66. 6.   Now write the file back to disk and quit debug.   The  patch
  67.      is complete.
  68.  
  69.      -w
  70.      Writing         bytes
  71.      -q
  72.  
  73.  
  74.                   Patching other Library Files
  75.  
  76. If  you  do  not  have  MicroSoft QuickBasic or  if  you  have  a
  77. different  version than I,  you can probably still  perform  this
  78. patch.   You  will  have to find the correct locations to  patch.
  79. The  addresses  054C  and  0839 were  found  with  the  following
  80. procedure:
  81.  
  82. 1.   Search  for the byte sequence 83 C2 04 32 C0 in the  library
  83.      file.   If you are lucky,  debug will find it in exactly two
  84.      places.
  85.  
  86.      (for example:)
  87.      -s 100 fff0 83 C2 04 32 C0
  88.  
  89. 2.   Unassemble   the  addresses  you  found.    The  first   two
  90.      instructions will be
  91.  
  92.           ADD  DX, +04
  93.           XOR  AL, AL
  94.  
  95.      Within the next few instructions should be
  96.  
  97.           OUT  DX, AL
  98.  
  99. 3.   If everything has gone correctly so far, just change the
  100.  
  101.           XOR  AL, AL
  102.  
  103.      to a
  104.  
  105.           MOV AL, 1
  106.  
  107. 4.   Perform this change in both places where the
  108.  
  109.           XOR AL, AL
  110.  
  111.      instruction was found.
  112.  
  113.  
  114. 5.   Write the updated file.
  115.  
  116. ------------- Additional Information for QuickBasic Version 2 ---------------
  117.  
  118.               By Jeff Sumberg - 02/03/87
  119.  
  120. The above instructions were correct in finding these items in 'other'
  121. versions. In fact the only difference I found was that the patches were
  122. required in only one location rather than two. Additionally I have located
  123. the patch in BRUN20.EXE as well as BCOM20.LIB
  124.  
  125. MAKE BACKUPS FIRST BEFORE PATCHING!
  126.  
  127. To Patch BCOM20.LIB
  128.  
  129. C>Debug Bcom20.Lib
  130. -a D36B
  131. xxxx:D36B Mov AL,1
  132. xxxx:D36D <cr>
  133. -w
  134. Writing xxxxx Bytes
  135. -q
  136.  
  137. To patch BRUN20.EXE
  138.  
  139. C>Rename Brun20.exe Brun20.x
  140. C>Debug Brun20.x
  141. -a 6459
  142. xxxx:6459 Mov AL,1
  143. xxxx:645B <cr>
  144. -w
  145. Writing xxxxx Bytes
  146. -q
  147. C>Rename Brun20.x Brun20.exe
  148.  
  149. These patches were tested by me and appear to work OK. These only work when
  150. compiling to BCOM20.OBJ, BRUN20.OBJ, & EXE. If you use the in-memory
  151. compilation method, DTR will still drop when you close the port or the program
  152. terminates so dont get upset. Apparently the DTR code is somewhere in QB.EXE
  153. also, but I was unable to find it. Besides you wont be using the compiler when
  154. you have this problem, its the finished product that was the trouble.
  155.  
  156. ------------- Additional Information for QuickBasic Version 3.0 -------------
  157.  
  158.               By Clint Labarthe - 05/17/87  (305) 260-6397
  159.  
  160. The above instructions were correct in finding these items in version 2.0
  161.  
  162. MAKE BACKUPS FIRST BEFORE PATCHING!
  163.  
  164. To Patch BCOM30.LIB
  165.  
  166. C>Debug Bcom30.Lib
  167. -a DC0B
  168. xxxx:DC0B Mov AL,1
  169. xxxx:DC0D <cr>
  170. -w
  171. Writing xxxxx Bytes
  172. -q
  173.  
  174. To patch BRUN30.EXE
  175.  
  176. C>Rename Brun30.exe Brun30.x
  177. C>Debug Brun30.x
  178. -a 6969
  179. xxxx:6969 Mov AL,1
  180. xxxx:696B <cr>
  181. -w
  182. Writing xxxxx Bytes
  183. -q
  184. C>Rename Brun30.x Brun30.exe
  185.  
  186. These patches were tested by me and appear to work OK. These only work when
  187. compiling to BCOM30.OBJ, BRUN30.OBJ, & EXE. If you use the in-memory
  188. compilation method, DTR will still drop when you close the port or the program
  189. terminates so dont get upset. Apparently the DTR code is somewhere in QB.EXE
  190. also, but I was unable to find it. Besides you wont be using the compiler when
  191. you have this problem, its the finished product that was the trouble.
  192.  
  193.  
  194. ------------- Additional Information for QuickBasic Version 4.0 -------------
  195.  
  196.               By Clint Labarthe - 12/23/87  (305) 260-6397
  197.  
  198. The above instructions were correct in finding these items in version 3.0
  199. The instructions below are different for patching BCOM40.LIB. I found
  200. the BCOM40.LIB info in a file: QBASIC40.PAT. I thank the author for it.
  201.  
  202. MAKE BACKUPS FIRST BEFORE PATCHING!
  203.  
  204. To Patch BCOM40.LIB
  205.  
  206. DEBUG BCOM40.LIB
  207. -D 100 L 5
  208. xxxx:0100
  209.  
  210. Take the first <3> numbers of 'xxxx' and add 85.  Example:  if you had
  211. something like   114F:0100  then you would add 85 to 114 and get 199.
  212. The new number you come up with will be 'yyy'. Remember this is HEX.
  213.  
  214. -S yyy0:0 FFFF 83 C2 04 32 C0
  215.  
  216. DEBUG will now give TWO locations where these bytes are located. Lets
  217. call the first address is   xxxx:yyyy
  218.  
  219. -U xxxx:yyyy L 6
  220.  
  221. You should see three lines.  the  'xxxx:yyyy' should be represented by
  222. a 'XOR AL AL'
  223.  
  224. -A xxxx:yyyy
  225. xxxx:yyyy MOV AL, 1      (assemble MOV AL, 1 at the xxxx:yyyy)
  226. xxxx:yyyy                (hit enter here)
  227.  
  228. Now repeat the process with the other number.  (starting at the U
  229. command)
  230. After you have done that, be sure to save the file:
  231.  
  232. -W
  233. Writing xxxx bytes
  234. -Q
  235.  
  236. To patch BRUN40.EXE
  237.  
  238. C>Rename Brun40.exe Brun40.x
  239. C>Debug Brun40.x
  240. -a 6D13
  241. xxxx:6D13 Mov AL,1
  242. xxxx:6D15 <cr>
  243. -a 6FDD
  244. xxxx:6FDD Mov AL,1
  245. xxxx:6FDF <cr>
  246. -w
  247. Writing xxxxx Bytes
  248. -q
  249. C>Rename Brun40.x Brun40.exe
  250.  
  251. Thats it !
  252.  
  253.